import httpInstance from '@/utils/http'

// 添加
export const addCartApi = ({ skuId, count }) => httpInstance({
    url: `/member/cart`,
    method: 'POST',
    data: {
        skuId,
        count
    }
})

// 获取
export const getCartApi = () => httpInstance({
    url: `/member/cart`,
})

// 删除
export const delCartApi = (ids) => httpInstance({
    url: `/member/cart`,
    method: 'DELETE',
    data: {
        ids
    }
})

// 合并 未登录/已登录状态下的购物车数据
export const mergeCartApi = (data) => httpInstance({
    url: `/member/cart/merge`,
    method: 'POST',
    data
})
